export default {
	
	
	setCountdown(state, countdown) {
		state.countdown = countdown
	},
	
	setGameCountdown(state, countdown) {
		state.countdownGame = countdown
	},

	startGlobalCountdown(state) {
		state.timer = setInterval(() => {
			state.countdown--;
			if (state.countdown <= 0) {
				clearInterval(state.timer);
				state.timer = null;
				state.countdown = 15;
			}
			
		}, 1000);
	},
	startGlobalGameCountdown(state) {
		state.ifGameEnd = false
		state.timerGame = setInterval(() => {
			state.countdownGame--;
			if (state.countdownGame <= 0) {
				clearInterval(state.timerGame);
				state.timerGame = null;
				state.countdownGame = 300;
				state.ifGameEnd = true
			}
			
		}, 1000);
	},

	stopGlobalCountdown(state) {
		clearInterval(state.timer);
		state.timer = null;
	},
	stopGlobalGameCountdown(state) {
		clearInterval(state.timerGame);
		state.timerGame = null;
		
	},
}